Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

βš—πŸ› [RUMF-1296] use pointerup to trigger click actions #1958

Merged
merged 9 commits into from
Jan 30, 2023

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented Jan 18, 2023

This ticket is part of an effort to improve dead clicks.

All three fixes are behind the dead_click_fixes and will be released together after some dogfooding.

Motivation

We observed that in some cases, click actions are flagged as "dead click" when the UI updates during "pointerup" or "mouseup" events (happening before the "click" event).

Changes

This PR fixes the issue by starting a "click action" on pointerup instead of click events. This slightly changes the start of each action, but this change should be minimal when there is no pointerup or mouseup event listener.

This is behind a feature flag as I want to assess the impact on org2 before enabling it.

This PR also improve the multitouch situation.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/frustration-signals--track-pointerup branch from baf6b21 to e08c7af Compare January 19, 2023 15:01
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2023

Codecov Report

Merging #1958 (3225f3d) into main (57d9e2a) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1958      +/-   ##
==========================================
+ Coverage   93.34%   93.42%   +0.08%     
==========================================
  Files         144      144              
  Lines        5482     5488       +6     
  Branches     1246     1251       +5     
==========================================
+ Hits         5117     5127      +10     
+ Misses        365      361       -4     
Impacted Files Coverage Ξ”
...ain/rumEventsCollection/action/actionCollection.ts 95.45% <ΓΈ> (ΓΈ)
...n/rumEventsCollection/action/listenActionEvents.ts 100.00% <100.00%> (ΓΈ)
...in/rumEventsCollection/action/trackClickActions.ts 98.26% <100.00%> (+0.03%) ⬆️
...rum-core/src/domain/contexts/foregroundContexts.ts 96.92% <0.00%> (+6.15%) ⬆️

πŸ“£ We’re building smart automated test selection to slash your CI/CD build times. Learn more

@BenoitZugmeyer BenoitZugmeyer marked this pull request as ready for review January 19, 2023 15:26
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner January 19, 2023 15:26
This commit will help implementing click actions triggered by pointerup
behind a FF.
In 'listenActionEvents', we expect that a 'click' event is preceded by
a single 'pointerdown' event. It turns out this is not always the case
on multitouch devices.

This issue would be amplified when listening to 'pointerup' events.

Let's just focus on the 'primary' pointer events. This will ignore
secondary touches until we implement proper support for them (if ever).
This slightly change the action beginning, but takes any activity
produced by 'pointerup' 'mouseup' 'touchend' events into account. If
those actions don't produce any activity, the action start is likely to
be the same as before, since 'pointerup/mouseup/touchend' should be
triggered very close to the 'click' event.
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/frustration-signals--track-pointerup branch from e08c7af to 7e96c15 Compare January 20, 2023 18:05
@BenoitZugmeyer BenoitZugmeyer merged commit 757ffbf into main Jan 30, 2023
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/frustration-signals--track-pointerup branch January 30, 2023 13:56
BenoitZugmeyer added a commit that referenced this pull request Feb 6, 2023
BenoitZugmeyer added a commit that referenced this pull request Feb 6, 2023
BenoitZugmeyer added a commit that referenced this pull request Feb 7, 2023
BenoitZugmeyer added a commit that referenced this pull request Feb 7, 2023
 pm_trace_id: 13144861
 feature_branch_pipeline_id: 13144861
 source: to-staging

* commit '6a98a9480c800aff92ce4c5d37270534623f7661':
  βœ… remove now unneeded experimental flag from e2e tests
  βœ…πŸ”₯ remove now unneeded clock mock in tests
  πŸš©πŸ› enable fix #1979
  πŸ”‡ remove pointerup_delay info for #1958
  πŸš©πŸ› enable fix #1958
  πŸš©πŸ› enable fix #1968
  πŸš©πŸ› enable fix #1986
BenoitZugmeyer added a commit that referenced this pull request Feb 10, 2023
* πŸš©πŸ› enable fix #1986

* πŸš©πŸ› enable fix #1968

* πŸš©πŸ› enable fix #1958

* πŸ”‡ remove pointerup_delay info for #1958

* πŸš©πŸ› enable fix #1979

* βœ…πŸ”₯ remove now unneeded clock mock in tests

* βœ… remove now unneeded experimental flag from e2e tests

* πŸ‘Œ rename `onStartEvent` to `onPointerUp`

* πŸ‘Œ rename startEvent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants